// 获取token
export const getToken = () => {
  return localStorage.getItem("token");
};

// 获取时间
export const getTimeChartData = (data: number) => {
  const date = new Date(data);
  const year = date.getFullYear();
  const month = String(date.getMonth() + 1).padStart(2, "0");
  const day = String(date.getDate()).padStart(2, "0");
  return `${year}-${month}-${day}`;
};

// 退出登录移除方法
export const removeUserInfo = () => {
  localStorage.removeItem("token");
  localStorage.removeItem("userInfo");
  localStorage.removeItem("role");
};

// 设置API地址
export const API_URL = "http://localhost:3000/api";
